import React, { Component } from 'react'
import styles from "./list.module.css"
const stateObj={//['ll','three','user']
   "ll":'浏览商品',
   'three':'30天最低价',
   'user':"同兴趣用户看了又看的好货"
}
export class List extends Component {
  render() {
      const{list}=this.props
    return (
      <div>
          <ul>
              {list.length?list.map((item,index)=>{
                  return <li key={index}>
                      <img src={item.img} alt="" />
                      <p>{item.title}</p>
                      <p>￥{item.price}</p>
                      <p className={styles[item.recommend]}>{stateObj[item.recommend]}</p>
                  </li>
              }):"暂无数据"}
          </ul>
      </div>
    )
  }
}

export default List